package com.example.sicnuaccountingapp.utils

import android.content.Context
import com.example.sicnuaccountingapp.R
import java.net.UnknownHostException
import java.sql.SQLException

object ErrorHandler {
    fun getErrorMessage(context: Context, throwable: Throwable): String {
        return when (throwable) {
            is UnknownHostException -> context.getString(R.string.error_network)
            is SQLException -> context.getString(R.string.error_database)
            else -> throwable.message ?: context.getString(R.string.error_unknown)
        }
    }
} 